#ifndef DISTRIBUTEDPACKETS_H_
#define DISTRIBUTEDPACKETS_H_

#include "../Solution/Solution.h"

enum Signal {REQUEST_JOB, ISSUE_JOB, JOB_RECIEVED, JOB_SUBMISSION, SUBMISSION_RECIEVED};

enum JobType {EVALUATE_FITNESS, CROSSOVER};

struct Packet {
    Signal signal;
    JobType jobType;
    Solution* solPtr1;
    Solution* solPtr2;
    double fitness;
};

class DistributedPackets {
    public:
        static int packetToBytes(char buffer[], int bufferSize, const Packet &packet);
        static void bytesToPacket(const char buffer[], int bufferSize, Packet &packet);
};

#endif /*DISTRIBUTEDPACKETS_H_*/
